home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / C for beginners.adf / source / backwards.c < prev    next >
C/C++ Source or Header  |  1978-01-17  |  452b  |  25 lines

  1. /* backwards.c 6.1 */
  2. void main()
  3. {
  4.   char input[81];
  5.   int index;
  6.  
  7.   printf("Please input some text!\n");
  8.   scanf("%s", input); /* Strings do not require & */
  9.  
  10.   for(index = 0; input[index] !=0; index = index + 1)
  11.     ;   /* Search for End mark! */ 
  12.  
  13.   printf("Your input >%s< has %d characters\n", input, index);
  14.  
  15. do
  16.  
  17.   {
  18.    index = index - 1;
  19.    printf("%c", input[index]);
  20.   }  while(index > 0);
  21.  
  22. printf("\n\n");  /*Blank line before Prompt */
  23. }
  24.  
  25.